package com.ysx.oa.resume.controller;

import com.ysx.oa.resume.Bean.JobBean;
import com.ysx.oa.resume.Bean.QuestionBean;
import com.ysx.oa.resume.dao.JobDao;
import com.ysx.oa.resume.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 黄德标
 * @date 2021/11/25 10:14
 */
@RestController
@RequestMapping("/job")
public class JobController {

    @Autowired
    private JobService jobService;

    @RequestMapping(value = "/addJob",method = RequestMethod.POST)
    public Map<String,Object> addJob(){
        Map<String,Object> map = new HashMap<>();

        ArrayList<JobBean> jobBeanArrayList = jobService.selectAllJobBean();

        map.put("code",200);
        map.put("message","success");
        map.put("data",jobBeanArrayList);
        return map;
    }


    /**
     * 方法描述:  查找 所有 岗位
     * URL: http://localhost:8080/kaoqin/job/selectAllJob
     * @author: 黄德标
     * @date: 2021/11/25 10:26
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     */
    @RequestMapping(value = "/selectAllJob",method = RequestMethod.GET)
    public Map<String,Object> selectAllJob(){
        Map<String,Object> map = new HashMap<>();

        ArrayList<JobBean> jobBeanArrayList = jobService.selectAllJobBean();

        map.put("code",200);
        map.put("message","success");
        map.put("data",jobBeanArrayList);
        return map;
    }

}